import request from '@/utils/request'
import { encryptionData } from '@/utils/com'
import Qs from 'qs'

/* 广告图列表 */
export function jcdAdvertColumn(data) {
  return request({
    url: '/jcdSys/jcdAdvertColumn/page',
    method: 'get',
    headers: encryptionData(data, '/jcdAdvertColumn/page'),
    params: data
  })
}
/* 广告图列表 添加 */
export function advertAdd(data) {
  return request({
    url: '/jcdSys/jcdAdvertColumn/advertAdd',
    method: 'post',
    headers: encryptionData(data, '/jcdAdvertColumn/advertAdd'),
    data: Qs.stringify(data)
  })
}
/* 广告图列表 修改 */
export function advertEdit(data) {
  return request({
    url: '/jcdSys/jcdAdvertColumn/advertEdit',
    method: 'put',
    headers: encryptionData(data, '/jcdAdvertColumn/advertEdit'),
    data: Qs.stringify(data)
  })
}
/* 广告图列表 删除 */
export function advertDelete(data) {
  return request({
    url: `/jcdSys/jcdAdvertColumn/advertDelete/${data.id}`,
    method: 'delete',
    headers: encryptionData(data, `/jcdAdvertColumn/advertDelete/${data.id}`),
    data: Qs.stringify(data)
  })
}
export function getList(data) {
  return request({
    url: '/jcdSys/config/getBannerImg',
    method: 'get',
    headers: encryptionData(data, '/config/getBannerImg'),
    params: data
  })
}
export function getList2(data) {
  return request({
    // url: '/jcdGys/comStore/backImg',
    url: '/jcdSys/jcdAdvertColumn/getAdvert',
    method: 'get',
    headers: encryptionData(data, '/jcdAdvertColumn/getAdvert'),
    params: data
  })
}
/* 修改首页广告图 */
export function saveList(data) {
  return request({
    url: '/jcdSys/config/bannerImgSave',
    method: 'post',
    headers: encryptionData(data, '/config/bannerImgSave'),
    data: Qs.stringify(data)
  })
}
